package com.WOWTradeNews.DataBase;

import com.WOWTradeNewsTest.R;

import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

public class ViewNews {
	private View baseView;
	private TextView idText;			
	private ImageView imageView;
	private TextView titleText;
	private TextView contentText;
	
	private ImageView adImg;
	private TextView adUrl;

    public ViewNews(View baseView) {
        this.baseView = baseView;
    }	
	
	public TextView getIdText() {		
        if (idText == null) {
        	idText = (TextView) baseView.findViewById(R.id.ItemID);
        }		
		return idText;
	}

	public ImageView getImageView() {
        if (imageView == null) {
        	imageView = (ImageView) baseView.findViewById(R.id.ItemImage);
        }		
		return imageView;
	}

	public TextView getTitleText() {
        if (titleText == null) {
        	titleText = (TextView) baseView.findViewById(R.id.ItemTitle);
        }		
		return titleText;
	}

	public TextView getSummaryText() {
        if (contentText == null) {
        	contentText = (TextView) baseView.findViewById(R.id.ItemText);
        }		
		return contentText;
	}
	
	public ImageView getAdImageView() {
		if(adImg == null) {
			adImg = (ImageView) baseView.findViewById(R.id.ad_item_img);
		}
		if(adImg != null)Log.d("zhaosdfa", "getAdImageView:"+adImg.toString());
		return adImg;
	}

	public TextView getAdUrl() {
		if (adUrl == null) {
			adUrl = (TextView) baseView.findViewById(R.id.ad_item_url);
        }		
		return adUrl;
	}
}